Write a custom CUDA kernel to optimize `P-TELU` with learnable parameters.

Formula:
  f(x) = x                     if x >= 0
  f(x) = alpha * tanh(beta * x)  if x < 0
where alpha and beta are trainable `nn.Parameter`s.

Problem Analysis:
1. Memory Bound: This is an element-wise activation with a conditional branch.
2. Operator Chaining: The PyTorch implementation using `torch.where` creates intermediate tensors.
3. Trainable Parameters: The kernel must accept `alpha` and `beta` as scalar inputs that are determined at runtime.

Optimization Strategy: Fused Element-wise Kernel with Vectorization

1. One-Thread-per-Element: Map each element to a CUDA thread.

2. Vectorized Loads (float4): Use `float4` to process 128 bits per memory transaction.

3. Fused Branching Logic:
   - The scalar parameters `alpha` and `beta` are passed to the kernel.
   - For each element `x`, check `if (x < 0)`.
   - If true, compute `alpha * tanhf(beta * x)`.
   - If false, result is `x`.

4. One-Pass: Fuse all steps into a single read-compute-write kernel.
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn

# --- 基准测试配置 ---
BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

# P-TELU 初始参数
ALPHA_INIT = 1.0
BETA_INIT = 1.0

class PTELU(nn.Module):
    '''
    P-TELU: Parametric Tan Hyperbolic Linear Unit Activation for Deep Neural Networks
    https://ieeexplore.ieee.org/document/8265328

    Formula:
      f(x) = x                       if x >= 0
      f(x) = alpha * tanh(beta * x)  if x < 0
    '''
    def __init__(self, alpha_init=1.0, beta_init=1.0):
        super(PTELU, self).__init__()
        self.alpha = nn.Parameter(torch.tensor(alpha_init))
        self.beta = nn.Parameter(torch.tensor(beta_init))

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        pos_part = x
        neg_part = self.alpha * torch.tanh(self.beta * x)
        return torch.where(x >= 0, pos_part, neg_part)

class Model(nn.Module):
    def __init__(self, alpha_init=1.0, beta_init=1.0):
        super(Model, self).__init__()
        self.act = PTELU(alpha_init, beta_init)
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32) * 5.0
    return [input_tensor.contiguous()]

def get_init_inputs():
    # 传递初始值
    return [ALPHA_INIT, BETA_INIT]